const friend=require('../dao/dbserver/friend')
const  {Edituser,EditEmail,EditPwd} = require('../dao/dbserver/user')
const {Modify} = require('../dao/dbserver/group')
const {updatamember} = require('../dao/dbserver/member')
const { read } = require('../dao/dbserver/message')


exports.pass = (req,res,next)=>{
    const {uid,fid} = req.body
    // console.log(req.fields);
    friend.pass(uid,fid,res)
}

exports.edituser = (req,res,next)=>{
    var {id ,obj} = req.body
    Edituser(id,obj,res)
}


exports.editemail = (req,res,next)=>{
    var {id,pwd,email} = req.body
    EditEmail(id,pwd,email,res)
}

exports.editpwd = (req,res,next)=>{
    var {id,opwd,npwd} = req.body
    EditPwd(id,opwd,npwd,res)
}

exports.editgroup = (req,res,next)=>{
    var {id,obj} = req.body
    Modify(id,obj,res)
}

exports.editmem = (req,res,next)=>{
    var {uid,gid,obj} = req.body
    updatamember(uid,gid,obj,res)
}

exports.Read = (req,res,next)=>{
  const {uid,fid} = req.body
  read(uid,fid,res)
}